<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>业主委员会：i友邻社区</title>
	<link href="${cpath}/css/youlin.css" rel="stylesheet" type="text/css" media="all" />
	<link  href="${cpath}/css/pop.css" rel="stylesheet" type="text/css">
	<SCRIPT src="${cpath}/js/global.js" type=text/javascript></SCRIPT>
</head>
<body>
<!--外套 start -->
<div class="wrap">
  <!--页首 start -->
	<%@ include file="/menu.jsp"%>
  <!--页首 end -->  
  
  <!--导航面包屑 start -->
  <div class="breadCrumb">
  <div class="breadCrumbNav">当前位置：<a href="${cpath}/users.do?action=main">我的主页</a> >> <a href="${cpath}/shequ_home/villageID_${theForm.villageID}.html"> 社区广场</a>>> <a > 业主委员会</a></div>
	<%@ include file="/navf.jsp"%>
 </div> 
  <!--导航面包屑 end -->
  
  <!--主体 start -->
 <div class="body">
   <div class="leftBox"> 
        
     <div class="leftBox-5">  
   <div class="leftBox-5-left">   
     <img src="${cpath}/images/img5.jpg" width="102" height="75" />
        <p><b>${myfn:getVillageName(theForm.villageID)}--业主委员会</b></p>
        <p>会员人数：${theForm.pepoleNum}</p>
        <p>成立日期：${myfn:formatYYYYMMDD(theForm.ctime,'-')}</p>
        <p>办公地址：${theForm.address}</p>
        <p>验证状态：${myfn:getMsg("STS_FLG", theForm.status)}</p>
   </div>
   <div class="leftBox-5-right">
     <p><b>有事您说话，马上办理！</b></p>
     <p><a href="javascript:openliuyan('1','${theForm.yeweiID}');"><img src="${cpath}/images/icon_18.gif" width="215" height="50" /></a></p>
   </div>

  </div>
   
  
  <div class="leftBox-3">
    <h3>日常联系人</h3>
   <div class="leftBox-5-left">   
     <A href="${cpath}/users_home/userID_${theForm.contactsID}.html" target=_blank><IMG height=110 src="${cpath}/${myfn:getUserPic(theForm.contactsID)}"  width="102" height="75" class="user_icon_1"
	  border=0> </A>
        <p><b><A href="${cpath}/users_home/userID_${theForm.contactsID}.html" target=_blank>${myfn:getUserNick(theForm.contactsID)}</A></b></p>
        <p>积分：${myfn:getUserIntegral(theForm.contactsID)}</p>
        <c:if test="${theForm.contactsID == userID }">	
		<p>当前有（<a href="javascript:disYanzh('divyanzh');">${yznum}</a>）条验证申请待处理</p>
        <p><a href="${cpath}/notadv.do?action=addPage&ntype=1&nsort=1&nsortID=${theForm.yeweiID}" class="lineColor1">发布公告</a>&nbsp;&nbsp;<a href="${cpath}/notadv.do?action=addPage&ntype=2&nsort=1&nsortID=${theForm.yeweiID}" class="lineColor1">发布通知</a></p>
        <p><a href="javascript:openNewDiv('addmember');">添加业委成员</a></p>
		</c:if>
   </div>
   <div class="leftBox-5-right">
     <p><b></b></p>
     <p><a href="javascript:openliuyan('5','${member.userID}');"><img src="${cpath}/images/icon_17.gif" width="215" height="45" /></a></p>
   </div>
   
    <div class="clearFloat"></div>
    </div>
     
     <div class="leftBox-3" style="display:none" id="divyanzh">
       <h3>申请验证会员</h3>
	   <div class="leftBox-3-content leftBox-3-sqcy">
		  <c:set value='0' var="pos"/>
		  <ul>
			<c:forEach var="yanzh" items="${yanzhlist}" varStatus="status">
			<c:if test="${pos%8==0&&pos!=0}"></ul><ul></c:if>
			<c:set value="${1+pos}" var="pos"/>
			<li>
			  <p><A href="${cpath}/users_home/userID_${yanzh.userID}.html" target=_blank><IMG height=80 src="${cpath}/${myfn:getUserPic(yanzh.userID)}" width="51" height="51" border=0 class="user_icon_1"></A></p>
			  <p>${myfn:getUserNick(yanzh.userID)}</p>
			  <p class="color_grey1"><a href="${cpath}/ywyanzh.do?action=update&yeweiID=${theForm.yeweiID}&userID=${yanzh.userID}&status=1"><img src="${cpath}/icon/okay.png" width="14" height="12" title="通过"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="${cpath}/ywyanzh.do?action=update&yeweiID=${theForm.yeweiID}&userID=${yanzh.userID}&status=2"><img src="${cpath}/icon/icon02.gif" width="14" height="12" title="不通过"/></a></p>
			</li>
			</c:forEach>
		  </ul>
		</div>
     </div>

	<div class="leftBox-3">
    <h3>业委会负责人</h3>
  	<c:forEach var="member" items="${memberlist}" varStatus="status"> 
	<c:if test="${member.post == '1' }">
   <div class="leftBox-5-left">   
     <A href="${cpath}/users_home/userID_${member.userID}.html" target=_blank><IMG height=110 src="${cpath}/${myfn:getUserPic(member.userID)}"  width="102" height="75" class="user_icon_1" 
	  border=0> </A>
        <p><b><A href="${cpath}/users_home/userID_${member.userID}.html" target=_blank>${myfn:getUserNick(member.userID)}</A></b></p>
        <p>积分：${myfn:getUserIntegral(member.userID)}</p>
   </div>

   <div class="leftBox-5-right">
     <p><b></b></p>
     <p><a href="javascript:openliuyan('5','${member.userID}');"><img src="${cpath}/images/icon_17.gif" width="215" height="45" /></a></p>
   </div>
   </c:if>
	</c:forEach>
   
    <div class="clearFloat"></div>
    </div>
     
     <div class="leftBox-3">
       <h3>业委会成员</h3>
		<div class="leftBox-3-content leftBox-3-sqcy">
	  <c:set value='0' var="pos"/>
      <ul>
	  	<c:forEach var="member" items="${memberlist}" varStatus="status">
		<c:if test="${member.post != '1' && member.userID != theForm.contactsID}">
		<c:if test="${pos%8==0&&pos!=0}"></ul><ul></c:if>
		<c:set value="${1+pos}" var="pos"/>
        <li>
          <p><A href="${cpath}/users_home/userID_${member.userID}.html" target=_blank><IMG  src="${cpath}/${myfn:getUserPic(member.userID)}" width="51" height="51" border=0 class="user_icon_1"></A></p>
          <p>${myfn:getUserNick(member.userID)}</p>
          <p class="color_grey1">积分：${myfn:getUserIntegral(member.userID)}</p>
        </li>
		</c:if>
		</c:forEach>
      </ul>
     </div>

     </div> 
   </div> 
    
  <div class="rightBox">
     <div class="rightBox-3">
       <div class="rightBox-3-content txtCenter">
         <a href="${cpath}/ywyanzh.do?action=add&yeweiID=${theForm.yeweiID}"><img src="${cpath}/images/icon_19.gif" width="138" height="44" /></a>
         <a href="${cpath}/ywguanzhu.do?action=add&yeweiID=${theForm.yeweiID}"><img src="${cpath}/images/icon_20.gif" width="138" height="44" /></a>
       </div>    
     </div>
     
     <div class="rightBox-2">
       <h3><span>公告</span><a class="more2" href="${cpath}/notadv.do?action=list&qryNtype=1&qryNsort=1&qryNsortID=${theForm.yeweiID}">+ 更多</a></h3>
      <div class="rightBox-2-content">
          <ul class="noticeList">
			<c:forEach var="notadv" items="${notadvlist}" varStatus="status">
			<c:if test="${notadv.ntype == '1'}">
			<li><span class="s1"><a href="${cpath}/notadv.do?action=detail&qrySeqID=${notadv.seqID}">${notadv.title}</a></span> <span class="s2">${myfn:formatYYYYMMDD(notadv.mtime,'/')}</span></li>
			</c:if>
			</c:forEach>
          </ul>
          <div class="clearFloat"></div>
      </div>
     </div>
     
	<div class="rightBox-2">
      <h3><span>通知</span><a class="more2" href="${cpath}/notadv.do?action=list&qryNtype=2&qryNsort=1&qryNsortID=${theForm.yeweiID}">+ 更多</a></h3>
      <div class="rightBox-2-content">
          <ul class="noticeList">
			<c:forEach var="notadv" items="${notadvlist}" varStatus="status">
			<c:if test="${notadv.ntype == '2'}">
			  <li><span class="s1"><a href="${cpath}/notadv.do?action=detail&qrySeqID=${notadv.seqID}">${notadv.title}</a></span> <span class="s2">${myfn:formatYYYYMMDD(notadv.mtime,'/')}</span></li>
			</c:if>
			</c:forEach>
          </ul>
          <div class="clearFloat"></div>
      </div>
     </div>
     
    <div class="rightBox-2">
      <h3><span>留言板</span><a class="more2" href="#">+ 更多</a></h3>
      <div class="rightBox-2-content">
                <ul class="leaveWord-list1">

					<c:forEach var="liuyan" items="${liuyanlist}" varStatus="status">  			
					<c:if test="${liuyan.follID == 0}">
                    <p  id="ly${liuyan.seqID}"><a href="${cpath}/users_home/userID_${liuyan.userID}.html" target="_blank">${myfn:getUserNick(liuyan.userID)}</a>${liuyan.content}</p>
                    <p class="p2">
					<c:if test="${userID == theForm.contactsID}">
					<a href="javascript:chgly('${liuyan.ntype}','${liuyan.nsort}','${liuyan.nsortID}','${liuyan.seqID}','${liuyan.title}');">[回复]</a> <a href="#">[删除]</a> 
					</c:if>&nbsp;
					<span>${myfn:formatMDHM(liuyan.mtime)}</span></p>
					</c:if>
					<c:if test="${liuyan.follID != 0}">
                    <p class="p3"><a href="${cpath}/users_home/userID_${liuyan.userID}.html" target="_blank">${myfn:getUserNick(liuyan.userID)}</a>: ${liuyan.content}<span>${myfn:formatMDHM(liuyan.mtime)}</span></p>
					</c:if>
					</c:forEach>
                </ul>   
                <form class="leaveWord2" action="${cpath}/notadv.do?action=add" name="form_liuyan" id="form_liuyan" method="post" >
                  <p><textarea name="content" rows="5" cols="33" ></textarea></p>
                  <p><a href="javascript:addliuyan('form_liuyan');"><img src="${cpath}/images/icon_09.gif" width="83" height="22" /></a></p>
					<input type="hidden" name='userID'	value='${userID}'/>
					<input type="hidden" name='nsort'	value='1'/>
					<input type="hidden" name='nsortID' value='${theForm.yeweiID}'/>
					<input type="hidden" name='ntype'	value='5'/>
					<input type="hidden" name='seqID'	value=''/>
					<input type="hidden" name='title'	value='${username}的留言'/>
				</form>
      </div>
     </div>
   </div>
    
    <div class="clearFloat"></div>
 </div> 
 <!--主体 end -->
 
 
 <!--页脚 start -->
	<%@ include file="/foot.jsp"%>
 <!--页脚 end --> 
</div>
<!--外套 end -->
		<!-- 转发 弹出层 -->
		<DIV class=dragdiv id=email style="DISPLAY:none ">
		<DIV class="otherdiv filterbox">
		<B class=g1></B><B class=g2></B><B class=g3></B><B class=g4></B>
		<DIV class="content filterbox"></DIV>
		<B class=g4></B><B class=g3></B><B class=g2></B><B class=g1></B></DIV>
		<DIV class=otherdivin>
		<H2><SPAN><A title=关闭 style="CURSOR: pointer" onclick="closeMask('email')"><IMG src="${cpath}/icon/icon02.gif"></A></SPAN>发送留言： </H2>
 		<form action="${cpath}/notadv.do?action=add" name="liuyanForm" id="liuyanForm"  method="post" >
			<DL  id="emaildl">
			<DD><EM>标  题：</EM><SPAN><input type='text' name='title' value='${username}的留言' class="long"/></SPAN></DD>
			<DD><textarea name="content" rows="10" cols="50" ></textarea>
			</DD>
			<DD><EM><INPUT type=button class='shortBtn' name=send value="确  定" onclick="addliuyan('liuyanForm');">&nbsp;&nbsp;
			<INPUT type=button class='shortBtn'  name=cancel value="取  消" onclick="closeMask('email');"></EM>
			</DD>
			</DL>
			<!--隐藏域-->
			<input type="hidden" name='userID'	value='${userID}'/>
			<input type="hidden" name='nsort'	value='1'/>
			<input type="hidden" name='nsortID' value='${theForm.yeweiID}'/>
			<input type="hidden" name='ntype'	value='5'/>
		</form>  
		</DIV></DIV><!-- 弹出层结束 -->

		<!-- 转发 弹出层 -->
		<DIV class=dragdiv id=addmember style="DISPLAY:none ">
		<DIV class="otherdiv filterbox">
		<B class=g1></B><B class=g2></B><B class=g3></B><B class=g4></B>
		<DIV class="content filterbox"></DIV>
		<B class=g4></B><B class=g3></B><B class=g2></B><B class=g1></B></DIV>
		<DIV class=otherdivin>
		<H2><SPAN><A title=关闭 style="CURSOR: pointer" onclick="closeMask('addmember')"><IMG src="${cpath}/icon/icon02.gif"></A></SPAN>添加业委成员： </H2>
 		<form action="${cpath}/ywmember.do?action=add" name="ywmemberForm" id="ywmemberForm"  method="post" >
			<DL >
			<DD><EM>成&nbsp;&nbsp;员&nbsp;&nbsp;ID：</EM><SPAN><input type='text' name='userID' value='' class="short" onblur="javascript:chkMember('membername','${theForm.yeweiID}',this.value);"/></SPAN></DD>
			<DD><EM>用&nbsp;&nbsp;户&nbsp;&nbsp;名：</EM><div id="membername"></div></DD>
			<DD><EM>成员类型：</EM><SPAN><tag:ARRAY  id="post" name="post" options="<%=ValueMaping.YWMEMBER_TYPE%>" value=''/></SPAN></DD>
			</DD>
			<DD><EM><INPUT type=button class='shortBtn' name=send value="确  定" onclick="madd();">&nbsp;&nbsp;
			<INPUT type=button class='shortBtn'  name=cancel value="取  消" onclick="closeMask('addmember');"></EM>
			</DD>
			</DL>
			<!--隐藏域-->
			<input type="hidden" name='yeweiID' value='${theForm.yeweiID}'/>
		</form>  
		</DIV></DIV><!-- 弹出层结束 -->
</body>
</html>
<script type="text/javascript">

		//弹出提示层
		function openNewDiv(_id) 
		{
				var m = "mask";
				if(document.getElementById(m)) document.body.removeChild(document.getElementById(m));
				var newMask = document.createElement("div");
				newMask.id = m;
				newMask.style.position = "absolute";
				newMask.style.zIndex = "1";
				_scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
				_scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
				newMask.style.width = _scrollWidth + "px";
				newMask.style.height = _scrollHeight + "px";
				newMask.style.top = "0px";
				newMask.style.left = "0px";
				newMask.style.background = "#33393C";
				newMask.style.filter = "alpha(opacity=40)";
				newMask.style.opacity = "0.30";
				document.body.appendChild(newMask);
				showDiv = document.getElementById(_id);
				showDiv.style.display = "block";
				showDiv.style.position = "absolute";
				showDiv.style.zIndex = "9999";
				showDivWidth = 488;
				showDivHeight = 314;
				showDiv.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - showDivHeight/2) + "px";
				showDiv.style.left = (document.documentElement.scrollLeft + document.documentElement.clientWidth/2 -  showDivWidth/2) + "px";
		}
		function closeMask(_id)
		{
				var m = "mask";
				if(document.getElementById(m)) document.body.removeChild(document.getElementById(m));
				showDiv = document.getElementById(_id);
				showDiv.style.display = "none";
		}

   /**
     * 检查项目资料维护
     */
	function oaddmember()
	{

		openNewDiv("addmember");
	}
	var existID = "no";
   /**
     * 检查项目资料维护
     */
	function openliuyan(sort,id)
	{
		var userID = "${userID}";
		if(userID == '' ){
			alert('留言需要登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		var form = document.liuyanForm;

		var nsort = form['nsort'];
		var nsortID = form['nsortID'];

		nsort.value = sort;
		nsortID.value = id;
		openNewDiv("email");

	}
	function chgly(type,sort,sortid,id,tit)
	{
		var form = document.form_liuyan;
		var ntype = form['ntype'];
		var nsort = form['nsort'];
		var nsortID = form['nsortID'];
		var seqID = form['seqID'];
		var title = form['title'];
		var content = form['content'];
		
		if(seqID.value != ""){
			document.getElementById('ly' + seqID.value).style.background = "#fff";
		}
		ntype.value = type;
		nsort.value = sort;
		nsortID.value = sortid;
		seqID.value = id;
		title.value = tit;
		document.getElementById('ly' + id).style.background = "#F2F3F6";

		content.focus();
	}
   /**
     * 检查项目资料维护
     */
	function madd()
	{

		var form = document.ywmemberForm;
		if(existID != "yes"){
			alert(existID)
			return false;
		}

		var userID = form['userID'];
		if(userID.value == null||userID.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('请输入会员ID');
			userID.select();
			return ;
		}

		form.submit();
	}
  /**
     * 检查项目资料维护
     */
	function addliuyan(objForm)
	{

		var userID = "${userID}";
		if(userID == '' ){
			alert('留言需要登录网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		var obj	= document.getElementById(objForm);

		var ntype = obj.ntype;
		if(ntype.value == "")
  		{
			alert('类型不能为空');
			ntype.select();
			return ;
		}
		var title = obj.title;
		if(title.value == null||title.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('标题不能为空');
			title.select();
			return ;
		}
		var nsort = obj.nsort;
		if(nsort.value == "")
  		{
			alert('板块不能为空');
			nsort.select();
			return ;
		}
		var content = obj.content;
		if(content.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
		{
			alert('内容不能为空');
			return ;
		}
		if(content.value.length > 2000)
		{
			alert('内容长度不能大于2000');
			return ;
		}
		obj.submit();
	}
	function disYanzh(id)
	{	
		var yznum = "${yznum}";
		if(document.getElementById(id).style.display == "none" && yznum > 0){
			document.getElementById(id).style.display = "";
		}else{
			document.getElementById(id).style.display = "none";
		}
	}

	function msgsubmit()
	{
		var form = document.form_msg;
		var sender = form['sender'];
		var receiver = form['receiver'];

		if(sender.value == '' ||receiver.value == ''){
			alert('请登陆网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		if(document.getElementById('msg').value == ''){
			alert('内容不能为空');
			return false;
		}
		if(document.getElementById('msg').value.length > 2000){
			alert('内容超长');
			return false;
		}
		document.getElementById('form_msg').submit();
	}
	function guanzhu(id)
	{
		var userID = "${userID}";
		if(userID == '' ){
			alert('请登陆网站');
			window.location.href ="${cpath}/index.jsp";
			return false;
		}
		window.location.href ="${cpath}/yeguanzh.do?action=add&userID=" + id;		
	}

   /**
    * 
    */
	function chkMember(div,ywid,id)
	{

		var xmlHttp;
		start = true;
		try
		{    // Firefox, Opera 8.0+, Safari    
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{    // Internet Explorer    
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		var url;
		
		url = "${cpath}/shequ/chkywMember.jsp?userID=" + id +"&yeweiID="+ywid;
		if (start)
		{
			my_getbyid(div).innerHTML='后台取数据……';
			xmlHttp.onreadystatechange=function()
			{
				if(xmlHttp.readyState==4 && xmlHttp.status==200)
				{
					var ret_str = xmlHttp.responseText;
					if(ret_str.replace(/(^\s*)|(\s*$)/g,"") == ""){
						existID = "会员ID不存在";
					
					}else if(ret_str.replace(/(^\s*)|(\s*$)/g,"") == "已经是业委成员"){
						my_getbyid(div).innerHTML = ret_str;
						existID = "已经是业委成员";
					}else{
						my_getbyid(div).innerHTML = ret_str;
						existID = "yes";
					}
				}
			}
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		}
	}

</script>
